#version 330 core
precision mediump float;

in vec2 tex_coord;
out vec4 frag_color;

uniform sampler2D image1;
uniform sampler2D image2;
uniform vec3 tex_color;
uniform float progress; // range from 0.0 to 1.0

#if 1
vec4 getFromColor(vec2 uv) {
  return texture(image1, uv);
}

vec4 getToColor(vec2 uv) {
  return texture(image2, uv);
}

vec4 transition (vec2 uv);

void main(void) {
  frag_color = transition(tex_coord) * vec4(tex_color, 1.0f);
}

#else

vec4 getFromColor(vec2 uv) {
  return texture(image1, -uv);
}

vec4 getToColor(vec2 uv) {
  return texture(image2, -uv);
}

vec4 transition (vec2 uv);

void main(void) {
  frag_color = transition(1.0 - tex_coord) * vec4(tex_color, 1.0f);
}
#endif
